package com.yb0os1.controller.user;

import com.yb0os1.entity.Category;
import com.yb0os1.result.Result;
import com.yb0os1.serve.CategoryServe;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userCategoryController")
@Tag(name = "C端分分类接口")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    private CategoryServe categoryServe;

    @GetMapping("/list")
    @Operation(summary = "分类查询")
    public Result<List<Category>> list(Integer type){
        return Result.success(categoryServe.getCategoryByType(type));
    }
}
